home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWString / Include / SLTxtRun.idl < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.7 KB  |  224 lines  |  [TEXT/MPS ]

  1. //==============================================================================
  2. //
  3. //    File:        SLTxtRun.idl
  4. //
  5. //    Contains:    Interface for OTextRunReader and OTextRunWriter classes
  6. //
  7. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  8. //
  9. //==============================================================================
  10.  
  11. #ifndef SLTXTRUN_IDL
  12. #define SLTXTRUN_IDL
  13.  
  14. #ifndef SLTXTTYP_IDL
  15. #include "SLTxtTyp.idl"
  16. #endif
  17.  
  18. #include <somobj.idl>
  19. #include <somcls.idl>
  20.  
  21. //========================================================================================
  22. // Interfaces defined in this unit
  23. //========================================================================================
  24.  
  25. interface   FW_OTextRunReader;
  26. interface   FW_OTextRunWriter;
  27. interface   FW_OMemoryRunReader;
  28. interface   FW_OMemoryRunWriter;
  29.  
  30. //========================================================================================
  31. // FW_OTextRunReader
  32. //========================================================================================
  33.  
  34. interface FW_OTextRunReader : SOMObject
  35. {
  36.     string GetCurrentRun(out FW_ByteCount length, out FW_Locale locale);
  37.         // Return the address, length, and locale of current text run
  38.  
  39.     boolean NextRun();
  40.         // Advance to the next run
  41.         // Return false if there are no more runs, i.e. current buffer is last run
  42.         // Call GetCurrentRun after calling NextRun to get start and length of new run.
  43.  
  44.     boolean PreviousRun();
  45.         // Backup to the previous run
  46.         // Return false if there are no more runs, i.e. current buffer is first run
  47.         // Call GetCurrentRun after calling PreviousRun to get start and length of new run.
  48.     
  49.     FW_ByteCount GetTotalLength();
  50.         // Return the total number of bytes available for reading.
  51.  
  52. #ifdef __SOMIDL__
  53.     implementation
  54.     {
  55.         functionprefix = "FW_OTextRunReader__";
  56.  
  57.         releaseorder:
  58.             GetCurrentRun,
  59.             NextRun,
  60.             PreviousRun,
  61.             GetTotalLength;
  62.  
  63.  
  64.         majorversion = 1;
  65.         minorversion = 0;
  66.  
  67.         passthru C_xh =
  68.             "";
  69.  
  70.         passthru C_xih =
  71.             "";
  72.  
  73. #ifdef __PRIVATE__    
  74.         // private data members here
  75. #endif
  76.  
  77.     };
  78. #endif
  79. };
  80.  
  81. //========================================================================================
  82. // FW_OTextRunWriter
  83. //========================================================================================
  84.  
  85. interface FW_OTextRunWriter : SOMObject
  86. {
  87.  
  88.     string GetCurrentRun(out FW_ByteCount length);
  89.         // Get start and length of current buffer.
  90.  
  91.     void FlushRun(in string buffer, in FW_ByteCount bytesToFlush);
  92.         // Flush bytes from the current buffer, possibly a subrange of current buffer
  93.  
  94.     boolean NewRun(in FW_Locale locale);
  95.         // Start a new run, where characters will be from specifed locale.
  96.         // Return false if the data structure cannot accept any more text,
  97.         // or if it cannot accept characters from the specified locale.
  98.         // GetCurrentRun must be called to get the buffer for the new run.
  99.  
  100. #ifdef __SOMIDL__
  101.     implementation
  102.     {
  103.         functionprefix = "FW_OTextRunWriter__";
  104.  
  105.         releaseorder:
  106.             GetCurrentRun,
  107.             FlushRun,
  108.             NewRun;
  109.  
  110.         majorversion = 1;
  111.         minorversion = 0;
  112.  
  113.         passthru C_xh =
  114.             "";
  115.  
  116.         passthru C_xih =
  117.             "";
  118.  
  119. #ifdef __PRIVATE__    
  120.         // private data members here
  121. #endif
  122.  
  123.     };
  124. #endif
  125. };
  126.  
  127. //========================================================================================
  128. // FW_OMemoryRunReader
  129. //========================================================================================
  130.  
  131. interface FW_OMemoryRunReader : FW_OTextRunReader
  132. {
  133.     FW_OMemoryRunReader Initialize(in string buffer, in FW_ByteCount length);
  134.  
  135. #ifdef __SOMIDL__
  136.     implementation
  137.     {
  138.         functionprefix = "FW_OMemoryRunReader__";
  139.  
  140.         override:
  141.             somInit,
  142.             somUninit,
  143.             GetCurrentRun,
  144.             NextRun,
  145.             PreviousRun,
  146.             GetTotalLength;
  147.  
  148.         releaseorder:
  149.             somInit,
  150.             somUninit,
  151.             GetCurrentRun,
  152.             NextRun,
  153.             PreviousRun,
  154.             GetTotalLength,
  155.             Initialize;
  156.  
  157.  
  158.         majorversion = 1;
  159.         minorversion = 0;
  160.  
  161.         passthru C_xh =
  162.             "";
  163.  
  164.         passthru C_xih =
  165.             "";
  166.  
  167. #ifdef __PRIVATE__    
  168.         // private data members here
  169.         char*            fBuffer;
  170.         FW_ByteCount     fLength;
  171. #endif
  172.  
  173.     };
  174. #endif
  175. };
  176.  
  177. //========================================================================================
  178. // FW_OMemoryRunWriter
  179. //========================================================================================
  180.  
  181. interface FW_OMemoryRunWriter : FW_OTextRunWriter
  182. {
  183.     FW_OMemoryRunWriter Initialize(in string buffer, in FW_ByteCount capacity);
  184.  
  185. #ifdef __SOMIDL__
  186.     implementation
  187.     {
  188.         functionprefix = "FW_OMemoryRunWriter__";
  189.  
  190.         override:
  191.             somInit,
  192.             somUninit,
  193.             GetCurrentRun,
  194.             FlushRun,
  195.             NewRun;
  196.  
  197.         releaseorder:
  198.             somInit,
  199.             somUninit,
  200.             GetCurrentRun,
  201.             FlushRun,
  202.             NewRun,
  203.             Initialize;
  204.  
  205.         majorversion = 1;
  206.         minorversion = 0;
  207.  
  208.         passthru C_xh =
  209.             "";
  210.  
  211.         passthru C_xih =
  212.             "";
  213.  
  214. #ifdef __PRIVATE__    
  215.         char*            fBuffer;
  216.         FW_ByteCount     fCapacity;
  217. #endif
  218.  
  219.     };
  220. #endif
  221. };
  222.  
  223. #endif
  224.